/**
 * Created by zhangjing on 2018/3/8.
 */
var config=require('../config');
var Redis=require('ioredis');
var logger=require('./logger');

var client=new Redis({
    port:config.redis_port,
    host:config.redis_host,
    db:config.redis_db,
    password:config.redis_password,
});


client.on('error',function (error) {
    if (error){
        logger.error("connect to redis error,check your redis config" ,error);
        process.exit(1);
    }
});

exports=module.exports=client;
